package com.heima.kafka.test;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.kafka.core.KafkaTemplate;

import javax.annotation.Resource;

@SpringBootTest
public class Producer {

    @Resource
    private KafkaTemplate kafkaTemplate;

    @Test
    public void sendMessage(){

        kafkaTemplate.send("kafka.topic.my-topic1","kafka","hello,kafka!!");
    }
}
